import 'package:equatable/equatable.dart';
import 'package:mobile_app.core/core/domain/entities/settings/training_settings.dart';

class LearningSettings extends Equatable {
  const LearningSettings({
    required this.autoPronunciationEnabled,
    required this.trainingSettings,
  });

  final bool autoPronunciationEnabled;
  final TrainingSettings trainingSettings;

  @override
  List<Object?> get props {
    return [
      autoPronunciationEnabled,
      trainingSettings,
    ];
  }

  LearningSettings copyWith({
    bool Function()? autoPronunciationEnabled,
    TrainingSettings Function()? trainingSettings,
  }) {
    return LearningSettings(
      autoPronunciationEnabled: autoPronunciationEnabled == null
          ? this.autoPronunciationEnabled
          : autoPronunciationEnabled(),
      trainingSettings:
          trainingSettings == null ? this.trainingSettings : trainingSettings(),
    );
  }
}
